commonlibsse_ng\re\h/
hkbProjectStringData.rs

1//! # hkbProjectStringData
2//!
3//! This module defines the `hkbProjectStringData` struct, which inherits from `hkReferencedObject`
4//! and represents string data related to the Havok project's animations, behaviors, and characters.
5
6use crate::re::hkArray::hkArray;
7use crate::re::hkReferencedObject::hkReferencedObject;
8use crate::re::hkStringPtr::hkStringPtr;
9use crate::re::offsets_rtti::RTTI_hkbProjectStringData;
10use crate::re::offsets_vtable::VTABLE_hkbProjectStringData;
11use crate::rel::id::VariantID;
12use std::mem;
13
14/// Represents string data for Havok project configurations.
15#[repr(C)]
16pub struct hkbProjectStringData {
17    /// Base class `hkReferencedObject`.
18    /// - Offset: `0x0`
19    pub __base: hkReferencedObject,
20
21    /// Array of animation filenames.
22    /// - Offset: `0x10`
23    pub animationFilenames: hkArray<hkStringPtr>,
24
25    /// Array of behavior filenames.
26    /// - Offset: `0x20`
27    pub behaviorFilenames: hkArray<hkStringPtr>,
28
29    /// Array of character filenames.
30    /// - Offset: `0x30`
31    pub characterFilenames: hkArray<hkStringPtr>,
32
33    /// Array of event names.
34    /// - Offset: `0x40`
35    pub eventNames: hkArray<hkStringPtr>,
36
37    /// Path to the animations.
38    /// - Offset: `0x50`
39    pub animationPath: hkStringPtr,
40
41    /// Path to the behaviors.
42    /// - Offset: `0x58`
43    pub behaviorPath: hkStringPtr,
44
45    /// Path to the characters.
46    /// - Offset: `0x60`
47    pub characterPath: hkStringPtr,
48
49    /// Path to the scripts.
50    /// - Offset: `0x68`
51    pub scriptsPath: hkStringPtr,
52
53    /// Full path to the source.
54    /// - Offset: `0x70`
55    pub fullPathToSource: hkStringPtr,
56
57    /// Root path.
58    /// - Offset: `0x78`
59    pub rootPath: hkStringPtr,
60}
61
62/// Ensure the memory layout matches the C++ version.
63const _: () = {
64    assert!(mem::size_of::<hkbProjectStringData>() == 0x80);
65    assert!(mem::offset_of!(hkbProjectStringData, __base) == 0x0);
66    assert!(mem::offset_of!(hkbProjectStringData, animationFilenames) == 0x10);
67    assert!(mem::offset_of!(hkbProjectStringData, behaviorFilenames) == 0x20);
68    assert!(mem::offset_of!(hkbProjectStringData, characterFilenames) == 0x30);
69    assert!(mem::offset_of!(hkbProjectStringData, eventNames) == 0x40);
70    assert!(mem::offset_of!(hkbProjectStringData, animationPath) == 0x50);
71    assert!(mem::offset_of!(hkbProjectStringData, behaviorPath) == 0x58);
72    assert!(mem::offset_of!(hkbProjectStringData, characterPath) == 0x60);
73    assert!(mem::offset_of!(hkbProjectStringData, scriptsPath) == 0x68);
74    assert!(mem::offset_of!(hkbProjectStringData, fullPathToSource) == 0x70);
75    assert!(mem::offset_of!(hkbProjectStringData, rootPath) == 0x78);
76};
77
78impl crate::re::hkRefPtr::hkRefPtrCounted for hkbProjectStringData {}
79
80impl Default for hkbProjectStringData {
81    fn default() -> Self {
82        Self::new()
83    }
84}
85
86impl hkbProjectStringData {
87    /// Address & Offset of the runtime type information (RTTI) identifier.
88    pub const RTTI: VariantID = RTTI_hkbProjectStringData;
89
90    /// Address & Offset of the virtual function table.
91    pub const VTABLE: [VariantID; 1] = VTABLE_hkbProjectStringData;
92
93    /// Creates a new `hkbProjectStringData` instance with default values.
94    ///
95    /// - Empty `hkArray` for filenames and event names.
96    /// - Empty `hkStringPtr` for paths.
97    #[inline]
98    pub fn new() -> Self {
99        Self {
100            __base: hkReferencedObject::new(),
101            animationFilenames: hkArray::new(),
102            behaviorFilenames: hkArray::new(),
103            characterFilenames: hkArray::new(),
104            eventNames: hkArray::new(),
105            animationPath: hkStringPtr::default(),
106            behaviorPath: hkStringPtr::default(),
107            characterPath: hkStringPtr::default(),
108            scriptsPath: hkStringPtr::default(),
109            fullPathToSource: hkStringPtr::default(),
110            rootPath: hkStringPtr::default(),
111        }
112    }
113}